﻿@model CSCSN.WebApplication.Models.UserDataVM

@{
    ViewData["Title"] = "Creat";
    Layout = "_LayoutNavigationBar";
}
<style>
    .myimg {
        max-height: 150px;
        max-width: 150px;
    }

    .rows .col-md-4 {
        float: left;
        margin-top: 50px;
        margin-left: 30px;
    }

    .control-label {
        position: absolute;
    }

    .form-control {
        margin-left: 70px;
    }

    .Sex {
        margin-left: 50px;
    }

    .form_input {
        height: 100px;
    }

    .custom-radio {
        margin-left: 70px;
        width: 200px;
    }

    .rows {
        height: 800px;
        overflow: hidden;
    }
</style>
<div class="right_content_title">
    <span class="right_content_title_text">请完善个人信息，不然不给登录.</span>
</div>
<div class="rows">
    <form asp-action="Creat" enctype="multipart/form-data" method="post">
        @Html.HiddenFor(Model => Model.ApplicationUsers, new { id = ViewBag.userID })
        <div class="col-md-4">
            <div class="form-group">

                <label asp-for="Hobby" class="control-label ">介绍</label>
                <input asp-for="Hobby" class="form-control form_input" />
                <span asp-validation-for="Hobby" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="StudentNumber" class="control-label">学号</label>
                <input asp-for="StudentNumber" class="form-control" />
                <span asp-validation-for="StudentNumber" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="RealName" class="control-label">真实姓名</label>
                <input asp-for="RealName" class="form-control" />
                <span asp-validation-for="RealName" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Phone" class="control-label">电话</label>
                <input asp-for="Phone" class="form-control" />
                <span asp-validation-for="Phone" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="College" class="control-label">学院</label>
                <select name="College" id="select1" class="form-control" onchange="change()"></select>
            </div>
            <div class="form-group">
                <label asp-for="ClassName" class="control-label">专业</label>
                <select name="ClassName" id="select2" class="form-control"></select>
                <span asp-validation-for="StudentNumber" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="StudentNumber" class="control-label">性别</label>
                <div class="custom-radio">
                    <label class="checkbox-inline">
                        <input type="radio" name="Sex" id="Sex" value="true" checked> 男
                    </label>
                    <label class="checkbox-inline">
                        <input type="radio" name="Sex" id="Sex" value="false"> 女
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label asp-for="Birthday" class="control-label">生日</label>
                <input type="date" name="Birthday" class="form-control" />
                <span asp-validation-for="Birthday" class="text-danger"></span>
            </div>

            <div class="form-group">
                <input type="submit" value="提 交" class="btn btn-primary" />
            </div>
        </div>
    </form>
</div>
@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
<script>
    //市级数组

    var shi = document.getElementById("select1");
    var all_shi = ["电子信息工程学院", "机电学院", "汽车学院", "贸旅学院"];
    //将所有的直辖市在第一个列表中显示
    var flag = "";
    for (var i = 0; i < all_shi.length; i++) {
        flag = flag + "<option value='" + i + "'>" + all_shi[i] + "</option>";
    } shi.innerHTML = flag;
    //各区的数组（各区的数组的下标对应的是该市的数组的下标）
    var qu = document.getElementById("select2");
    var all_qu = [
        ["软件一班", "软件二班", "软件三班", "软件四班", "大数据一班", "大数据二班", "大数据三班", "大数据四班", "人工智能一班", "人工智能二班", "人工智能三班", "外包一班", "外包二班", "通信一班", "通信二班", "计算机技术一班", "计算机技术二班"],
        ["机械设计与制造一班", "机械设计与制造二班", "机械设计与制造三班", "机械设计与制造四班", "工业机器人技术一班", "工业机器人技术二班", "工业机器人技术三班", "工业机器人技术四班", "数控设备应用与维护一班", "数控设备应用与维护二班", "数控设备应用与维护三班", "数控设备应用与维护四班", "数控技术一班", "数控技术二班", "数控技术三班", "焊接技术与自动化一班", "焊接技术与自动化二班", "焊接技术与自动化三班"],
        ["汽车运用与维修技术一班", "汽车运用与维修技术二班", "汽车运用与维修技术三班", "汽车运用与维修技术四班", "汽车车身维修技术一班", "汽车车身维修技术二班", "汽车车身维修技术三班", "汽车营销与服务一班", "汽车营销与服务二班", "汽车营销与服务三班", "汽车营销与服务四班", "汽车电子技术一班", "汽车电子技术二班", "汽车电子技术三班", "汽车电子技术四班"],
        ["酒店管理一班", "酒店管理二班", "酒店管理三班", "酒店管理四班", "旅游管理一班", "旅游管理二班", "旅游管理三班", "旅游管理四班"]
    ];
    //将默认的北京市的所有区在第二个列表中显示
    flag = "";
    for (var n = 0; n < all_qu[0].length; n++) {
        flag = flag + "<option>" + all_qu[0][n] + "</option>";
    } qu.innerHTML = flag;

    //市级部分的回调函数
    function change() {
        //获取第一个列表对象
        flag = "";
        for (var j = 0; j < all_qu[shi.value].length; j++) {
            flag = flag + "<option >" + all_qu[shi.value][j] + "</option>";
        } qu.innerHTML = flag;
    }
</script>